package mid;

public class a74_搜索二维矩阵 {
    public boolean searchMatrix(int[][] matrix, int target) {
        int row=matrix.length;
        int col=matrix[0].length;
        for(int i=0;i<row;i++){
            if(target>=matrix[i][0]&&target<=matrix[i][col-1]){
                for(int j=0;j<col;j++){
                    if(matrix[i][j]==target){
                        return true;
                    }
                }
            }
        }
        return false;
    }
}
